package vn.edu.saigontech.ncms.web.teacher.report;

import vn.edu.saigontech.ncms.model.info.Offering;

public class OfferingTeachingDetail {

	private Offering offering;
	private int advanceHours;
	private double hoursPerSession;
	private int sessions;
	private String comment;
	private boolean hasTestDate;

	public OfferingTeachingDetail(Offering offering, int advanceHours, double hoursPerSession, int sessions, String comment, boolean hasTestDate) {
		this.hoursPerSession = hoursPerSession;
		this.advanceHours = advanceHours;
		this.offering = offering;
		this.sessions = sessions;
		this.comment = comment;
		this.hasTestDate = hasTestDate;
	}
	
	public OfferingTeachingDetail(Offering offering, int advanceHours, double hoursPerSession, int sessions, String comment) {
		this(offering, advanceHours,hoursPerSession,sessions,comment, true);
	}

	public double getTeachingHours() {
		return this.hoursPerSession * this.sessions;
	}
	
	public Offering getOffering() {
		return offering;
	}

	public int getSessions() {
		return sessions;
	}
	
	public void setSessions(int sessions) {
		this.sessions = sessions;
	}

	public double getHoursPerSession() {
		return hoursPerSession;
	}

	public String getComment() {
		return comment;
	}

	public void setComment(String comment) {
		this.comment = comment;
	}

	public void setOffering(Offering offering) {
		this.offering = offering;
	}

	public void setHoursPerSession(double hoursPerSession) {
		this.hoursPerSession = hoursPerSession;
	}

	public int getAdvanceHours() {
		return advanceHours;
	}

	public void setAdvanceHours(int advanceHours) {
		this.advanceHours = advanceHours;
	}
	
	public boolean isHasTestDate() {
		return hasTestDate;
	}

	public void setHasTestDate(boolean hasTestDate) {
		this.hasTestDate = hasTestDate;
	}
	
	@Override
	public boolean equals(Object obj) {
		return this.getOffering().equals(((OfferingTeachingDetail)obj).getOffering());
	}
}